package com.goldsprite.microhorigame.ecs.fsms.states;

public class EntityFallState extends EntityState {
		@Override
		public boolean canEnter() {
			return !fsm.getFootTrigger().isGround() && fsm.getRigi().getVelocity().y < 0;
		}

		@Override
		public boolean canExit() {
			return fsm.getFootTrigger().isGround();
		}

		@Override
		public void enter() {
			fsm.getAnims().playAnim("Fall", true);
		}

		@Override
		public void running() {
			//跌落时可移动
			fsm.getProps().move(fsm.getInputs().getKeyDirX());
		}
	}
